package com.sk.bilibili.controller;

import com.sk.bilibili.other.R;
import com.sk.bilibili.service.AndroidService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 邵康
 * @date 2021/12/4 9:03
 */
@Api(tags = "安卓专用api集合")
@CrossOrigin
@RestController
@RequestMapping("/android")
public class AndroidController {

    @Autowired
    private AndroidService androidService;

    @ApiOperation("安卓端特供  更新开屏图片")
    @PostMapping("/updateFlash")
    public R<Void> updateFlash(MultipartFile flash){
        return androidService.updateFlash(flash);
    }

    @ApiOperation("安卓端特供  更新应用")
    @PostMapping("/updateApp")
    public R<Void> updateApp(MultipartFile app,Integer appVersion){
        return androidService.updateApp(app,appVersion);
    }

    @ApiOperation("用于更新安卓下载页面")
    @PostMapping("/updateAppPage")
    public R<Void> updateAppPage(MultipartFile appPage){
        return androidService.updateAppPage(appPage);
    }

    @ApiOperation("获取最新开屏图片")
    @GetMapping("/getFlash")
    public R<String> getFlash(){
        return androidService.getFlash();
    }

    @ApiOperation("获取最新APP")
    @GetMapping("/getApp")
    public R<String> getApp(){
        return androidService.getApp();
    }

}
